FROM centos:centos7

COPY Centos-7.repo /tmp/Centos-7.repo

RUN mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup && cp /tmp/Centos-7.repo /etc/yum.repos.d/CentOS-Base.repo

RUN sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo

RUN yum makecache

RUN yum install epel-release pcre-devel openssl-devel gcc curl git wget gcc g++ make postgresql-devel GeoIP GeoIP-devel GeoIP-data  vim -y

RUN cd /tmp && git clone https://gitee.com/ShJieZhou/nginx-module-vts.git


RUN cd /tmp && wget https://openresty.org/download/openresty-1.21.4.3.tar.gz &&tar -xzvf openresty-1.21.4.3.tar.gz

RUN cd /tmp/openresty-1.21.4.3 && ./configure --prefix=/opt/openresty --with-luajit --with-http_iconv_module --with-http_postgres_module --with-http_geoip_module --add-module=/tmp/nginx-module-vts  && make && make install
#RUN ln -sf /opt/openresty/nginx/sbin/nginx /opt/openresty/bin/openresty
ENTRYPOINT ["/opt/openresty/nginx/sbin/nginx", "-g", "daemon off;"]
